# Makefile for building and cleaning subdirectories

# List all subdirectories containing their own Makefiles
SUBDIRS := $(wildcard */)

BUILD_DIR = /home/fison/eb_sw/imx6ull/driver/build/driver

# Default target - builds all subdirectories
all: $(SUBDIRS)

# Rule to build each subdirectory
$(SUBDIRS):
	$(MAKE) -C $@

# Clean target - cleans all subdirectories
clean: $(addsuffix .clean,$(SUBDIRS))

# Pattern rule for cleaning each subdirectory
%.clean:
	$(MAKE) -C $(basename $@) clean

# Phony targets to prevent conflicts with files/directories
.PHONY: all clean $(SUBDIRS)

clean-build:
	rm -rf $(BUILD_DIR)/*